<?php
declare (strict_types = 1);

namespace app\admin\controller;

use app\admin\controller\Common;
use think\Request;
use think\facade\View;

class Settings extends Common
{
	public function __construct(){
		parent::__construct();
		$this->model = new \app\admin\model\Settings;
		View::assign('model',$this->model);
		View::assign('title',"网站配置");
		$this->validate = new \app\admin\validate\Settings;

		/**
		 * 表结构
		 */
		$this->tables = config('tables.settings');
		View::assign('tables',$this->tables);

		$this->auth_rule = [
			[
				'name'  => "settings/index",
				'title' => "基础配置-列表",
				'class' => "settings",
			],
			[
				'name'  => "settings/create",
				'title' => "基础配置-添加",
				'class' => "settings",
			],
			[
				'name'  => "settings/read",
				'title' => "基础配置-阅读",
				'class' => "settings",
			],
			[
				'name'  => "settings/edit",
				'title' => "基础配置-修改",
				'class' => "settings",
			],
			[
				'name'  => "settings/delete",
				'title' => "基础配置-删除",
				'class' => "settings",
			],
		];
	}
	
	/**
	 * 排序
	 */
	protected function order(){
		return "create_time desc,id desc";
	}
}
